package pl.model;

import java.text.DateFormatSymbols;
import java.util.Locale;

import org.apache.tapestry.form.IPropertySelectionModel;

public class LocalisedMonthsModel implements IPropertySelectionModel {

	   

    private String[] months;

   

    public LocalisedMonthsModel(Locale locale) {

        DateFormatSymbols symbols = new DateFormatSymbols(locale);

        months = symbols.getMonths();

    }

   

    public String getLabel(int index) {

        return months[index];

    }

   

    public Object getOption(int index) {

        return index;

    }

   

    public int getOptionCount() {

        return 12;

    }

   

    public String getValue(int index) {

        return "" + index;

    }

   

    public Object translateValue(String value) {

        return Integer.parseInt(value);

    }



	@Override
	public boolean isDisabled(int arg0) {
		// TODO Auto-generated method stub
		return false;
	}

   

}